﻿using UnityEngine;
using System;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;

public class Technology
{

	public enum TechCategory
	{
		General = 0,
		Military = 1,
		Planetary = 2,
		Cosmology = 3,
		Ecology = 4,
		Sociology = 5
	}

	public enum TechStatus
	{
		Obsolete = 0,
		Unknown = 1,
		Known = 2,
		Owned = 3,
	}
	

	// Declaration
	private GameEnums.TechName m_Name;
	private TechCategory m_Category;
	private Galaxy.Civilization m_Stage;
	private double m_Cost;										// scientific cost for researching
	private bool m_Key;												// whether it is an indicative key technology
	private bool m_Valid;
	private bool m_Optional;									// whether it is an optional technology

	private GameEnums.TechName[] m_Dependent = new GameEnums.TechName[]{};


	#region getters and setters
	public GameEnums.TechName Name
	{
		get { return m_Name; }
	}

	public TechCategory Category
	{
		get { return m_Category; }
		set { m_Category = value; }
	}

	public Galaxy.Civilization Stage
	{
		get { return m_Stage; }
		set { m_Stage = value; }
	}


	public double Cost
	{
		get { return m_Cost; }
		set { m_Cost = value; }
	}

	public bool Key
	{
		get { return m_Key; }
		set { m_Key = value; }
	}

	public bool Valid
	{
		get { return m_Valid; }
		set { m_Valid = value; }
	}

	public bool Optional
	{
		get { return m_Optional; }
		set { m_Optional = value; }
	}


	public GameEnums.TechName[] Dependent
	{
		get { return m_Dependent; }
		set { m_Dependent = value; }
	}
	#endregion


	// Constructor
	public Technology(GameEnums.TechName name, TechCategory category, Galaxy.Civilization stage, double cost, bool key, bool valid, GameEnums.TechName[] ldepend)
	{
		m_Name = name;
		m_Category = category;
		m_Stage = stage;
		m_Cost = cost;
		m_Key = key;
		m_Valid = valid;
		m_Dependent = ldepend;
	}

	private static Technology[] m_Table = new Technology[]						// 287 technologies by far
	{
		new Technology(GameEnums.TechName.ColonyBase, TechCategory.Planetary, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.AdvancedElectronics, TechCategory.General, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedPhysics}),
		new Technology(GameEnums.TechName.ElectronicComputer, TechCategory.General, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedElectronics}),
		new Technology(GameEnums.TechName.AdvancedLaserTechnology, TechCategory.General, Galaxy.Civilization.Primitive, 50, false, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.LaserCannon, TechCategory.Military, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedLaserTechnology}),
		new Technology(GameEnums.TechName.LaserRifle, TechCategory.Military, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedLaserTechnology}),
		new Technology(GameEnums.TechName.AdvancedPhysics, TechCategory.General, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.SpaceScanner, TechCategory.Cosmology, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedPhysics}),
		new Technology(GameEnums.TechName.AdvancedEnergyResearch, TechCategory.General, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.ExtendedFuelTanks, TechCategory.General, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedEnergyResearch}),
		new Technology(GameEnums.TechName.AdvancedEngineering, TechCategory.General, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.StandardFuelCells, TechCategory.Cosmology, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedEngineering}),
		new Technology(GameEnums.TechName.NuclearMissile, TechCategory.Military, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedPhysics}),
		new Technology(GameEnums.TechName.NuclearBomb, TechCategory.Military, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedPhysics}),
		new Technology(GameEnums.TechName.NuclearDrive, TechCategory.Cosmology, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedPhysics}),
		new Technology(GameEnums.TechName.AdvancedMetallurgy, TechCategory.General, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.TitaniumArmor, TechCategory.Military, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedMetallurgy}),
		new Technology(GameEnums.TechName.Freighters, TechCategory.Sociology, Galaxy.Civilization.Primitive, 50.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedEngineering}),
		new Technology(GameEnums.TechName.AdvancedConstruction, TechCategory.Planetary, Galaxy.Civilization.Primitive, 80.0, false, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.StarBase, TechCategory.Planetary, Galaxy.Civilization.Primitive, 80.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedConstruction, GameEnums.TechName.ColonyBase}),
		new Technology(GameEnums.TechName.AdvancedEcology, TechCategory.Ecology, Galaxy.Civilization.Primitive, 80.0, false, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.Biospheres, TechCategory.Ecology, Galaxy.Civilization.Primitive, 80.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedEcology}),
		new Technology(GameEnums.TechName.HydroponicFarm, TechCategory.Planetary, Galaxy.Civilization.Primitive, 80.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedEcology}),
		new Technology(GameEnums.TechName.AntiMissileRockets, TechCategory.Military, Galaxy.Civilization.Primitive, 80.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedPhysics}),
		new Technology(GameEnums.TechName.ReinforcedHull, TechCategory.Military, Galaxy.Civilization.Primitive, 80.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedEngineering}),
		new Technology(GameEnums.TechName.FighterBays, TechCategory.Military, Galaxy.Civilization.Primitive, 80.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedEngineering}),
		new Technology(GameEnums.TechName.ColonyShip, TechCategory.Cosmology, Galaxy.Civilization.Primitive, 80.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedEngineering}),
		new Technology(GameEnums.TechName.OutpostShip, TechCategory.Cosmology, Galaxy.Civilization.Primitive, 80.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedEngineering}),
		new Technology(GameEnums.TechName.AdvancedOptics, TechCategory.General, Galaxy.Civilization.Primitive, 80.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedPhysics}),
		new Technology(GameEnums.TechName.OuterSpaceSatellites, TechCategory.Cosmology, Galaxy.Civilization.Primitive, 80.0, true, false, new GameEnums.TechName[]{GameEnums.TechName.AdvancedOptics}),
		new Technology(GameEnums.TechName.SpaceTransportation, TechCategory.Cosmology, Galaxy.Civilization.Primitive, 80.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedPhysics, GameEnums.TechName.AdvancedEngineering, GameEnums.TechName.AdvancedMetallurgy}),
		new Technology(GameEnums.TechName.AdvancedManufacturing, TechCategory.General, Galaxy.Civilization.Primitive, 150.0, true, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.AutomatedFactories, TechCategory.Planetary, Galaxy.Civilization.Primitive, 150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedManufacturing}),
		new Technology(GameEnums.TechName.AdvancedParallelComputing, TechCategory.General, Galaxy.Civilization.Primitive, 150.0, true, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.HeavyArmor, TechCategory.Military, Galaxy.Civilization.Primitive, 150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedMetallurgy, GameEnums.TechName.AdvancedEngineering}),
		new Technology(GameEnums.TechName.MissileBase, TechCategory.Military, Galaxy.Civilization.Primitive, 150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedConstruction}),
		new Technology(GameEnums.TechName.DauntlessGuidanceSystem, TechCategory.Military, Galaxy.Civilization.Primitive, 150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedLaserTechnology, GameEnums.TechName.AdvancedOptics}),
		new Technology(GameEnums.TechName.Optronics, TechCategory.General, Galaxy.Civilization.Primitive, 150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedOptics, GameEnums.TechName.AdvancedPhysics}),
		new Technology(GameEnums.TechName.OptronicComputer, TechCategory.General, Galaxy.Civilization.Primitive, 150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedElectronics, GameEnums.TechName.Optronics}),
		new Technology(GameEnums.TechName.ResearchLaboratory, TechCategory.General, Galaxy.Civilization.Primitive, 150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedConstruction, GameEnums.TechName.AdvancedPhysics}),
		new Technology(GameEnums.TechName.AdvancedFusion, TechCategory.General, Galaxy.Civilization.Primitive, 150.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedPhysics}),
		new Technology(GameEnums.TechName.FusionBeam, TechCategory.Military, Galaxy.Civilization.Primitive, 150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedFusion}),
		new Technology(GameEnums.TechName.FusionRifle, TechCategory.Military, Galaxy.Civilization.Primitive, 150, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedFusion}),
		new Technology(GameEnums.TechName.AdvancedEducation, TechCategory.Sociology, Galaxy.Civilization.Primitive, 150, false, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.SpaceAcademy, TechCategory.Sociology, Galaxy.Civilization.Primitive, 150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedEducation}),
		new Technology(GameEnums.TechName.AugmentedEngines, TechCategory.Cosmology, Galaxy.Civilization.Primitive, 250.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedFusion}),
		new Technology(GameEnums.TechName.FusionBomb, TechCategory.Military, Galaxy.Civilization.Primitive, 250.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedFusion}),
		new Technology(GameEnums.TechName.FusionDrive, TechCategory.Cosmology, Galaxy.Civilization.Primitive, 250.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedFusion}),
		new Technology(GameEnums.TechName.AdvancedElectroMagnetics, TechCategory.General, Galaxy.Civilization.Primitive, 250.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedPhysics}),
		new Technology(GameEnums.TechName.ClassIShield, TechCategory.Military, Galaxy.Civilization.Primitive, 250.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedElectroMagnetics}),
		new Technology(GameEnums.TechName.ECMJammer, TechCategory.Military, Galaxy.Civilization.Primitive, 250.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.ResearchLaboratory}),
		new Technology(GameEnums.TechName.MassDriver, TechCategory.Military, Galaxy.Civilization.Primitive, 250.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.FusionBeam}),
		new Technology(GameEnums.TechName.DeuteriumFuelCells, TechCategory.Cosmology, Galaxy.Civilization.Primitive, 250.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedFusion}),
		new Technology(GameEnums.TechName.TritaniumArmor, TechCategory.Military, Galaxy.Civilization.Primitive, 250.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.TitaniumArmor}),
		// new tree
		new Technology(GameEnums.TechName.BattlePods, TechCategory.Military, Galaxy.Civilization.Medieval, 250.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.TritaniumArmor, GameEnums.TechName.AstroBiology}),
		new Technology(GameEnums.TechName.SurvivalPods, TechCategory.Military, Galaxy.Civilization.Medieval, 250.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.FighterBays}),
		new Technology(GameEnums.TechName.TroopPods, TechCategory.Military, Galaxy.Civilization.Medieval, 250.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.MilitaryTactics}),
		new Technology(GameEnums.TechName.AstroBiology, TechCategory.General, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.NuclearFission, TechCategory.General, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.MilitaryTactics, TechCategory.Military, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.SpaceAcademy}),
		new Technology(GameEnums.TechName.FusionPhysics, TechCategory.General, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedFusion}),
		new Technology(GameEnums.TechName.ColdFusion, TechCategory.General, Galaxy.Civilization.Medieval, 400.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.NuclearFission, GameEnums.TechName.FusionPhysics}),
		new Technology(GameEnums.TechName.CapsuleConstuction, TechCategory.Military, Galaxy.Civilization.Medieval, 400.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.TritaniumArmor, GameEnums.TechName.AstroBiology}),
		new Technology(GameEnums.TechName.ArtificialIntelligence, TechCategory.Sociology, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedEducation}),
		new Technology(GameEnums.TechName.TachyonPhysics, TechCategory.General, Galaxy.Civilization.Medieval, 400.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.ColdFusion, GameEnums.TechName.FusionPhysics}),
		new Technology(GameEnums.TechName.AstroEngineering, TechCategory.General, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.TachyonPhysics, GameEnums.TechName.SpaceAcademy}),
		new Technology(GameEnums.TechName.BattleScanner, TechCategory.Military, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedOptics}),
		new Technology(GameEnums.TechName.TachyonCommunications, TechCategory.Cosmology, Galaxy.Civilization.Medieval, 400.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.TachyonPhysics, GameEnums.TechName.AdvancedElectroMagnetics}),
		new Technology(GameEnums.TechName.TachyonScanner, TechCategory.Cosmology, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.TachyonPhysics}),
		new Technology(GameEnums.TechName.ArmorBarracks, TechCategory.Military, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.TroopPods}),
		new Technology(GameEnums.TechName.FighterGarrison, TechCategory.Military, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.FighterBays, GameEnums.TechName.FusionDrive}),
		new Technology(GameEnums.TechName.SpacePort, TechCategory.Sociology, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AstroEngineering}),
		new Technology(GameEnums.TechName.NeuralScanner, TechCategory.Military, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.ArtificialIntelligence}),
		new Technology(GameEnums.TechName.ScoutLab, TechCategory.Military, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.TachyonPhysics, GameEnums.TechName.MilitaryTactics}),
		new Technology(GameEnums.TechName.SecurityStations, TechCategory.Military, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.TachyonScanner}),
		new Technology(GameEnums.TechName.CloningCenter, TechCategory.Ecology, Galaxy.Civilization.Medieval, 400.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.AstroBiology, GameEnums.TechName.NeuralScanner, GameEnums.TechName.ScoutLab}),
		new Technology(GameEnums.TechName.DeathSpores, TechCategory.Military, Galaxy.Civilization.Medieval, 400.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.BattleScanner}),
		new Technology(GameEnums.TechName.SoilEnrichment, TechCategory.Planetary, Galaxy.Civilization.Medieval, 400.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.SpacePort, GameEnums.TechName.TachyonCommunications}),
		new Technology(GameEnums.TechName.XenoRelationship, TechCategory.Sociology, Galaxy.Civilization.Medieval, 650, false, true, new GameEnums.TechName[]{GameEnums.TechName.SpacePort}),
		new Technology(GameEnums.TechName.Robotics, TechCategory.General, Galaxy.Civilization.Medieval, 650.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.TachyonPhysics, GameEnums.TechName.ArtificialIntelligence}),
		new Technology(GameEnums.TechName.BattleStation, TechCategory.Military, Galaxy.Civilization.Medieval, 650.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.BattleScanner, GameEnums.TechName.SecurityStations, GameEnums.TechName.CapsuleConstuction}),
		new Technology(GameEnums.TechName.PoweredArmor, TechCategory.Military, Galaxy.Civilization.Medieval, 650.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.ArmorBarracks}),
		new Technology(GameEnums.TechName.RoboMiningPlant, TechCategory.Planetary, Galaxy.Civilization.Medieval, 650, true, true, new GameEnums.TechName[]{GameEnums.TechName.Robotics, GameEnums.TechName.PoweredArmor}),
		new Technology(GameEnums.TechName.MerculiteMissile, TechCategory.Military, Galaxy.Civilization.Medieval, 650.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.DeathSpores}),
		new Technology(GameEnums.TechName.PollutionProcessor, TechCategory.Planetary, Galaxy.Civilization.Medieval, 650.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.CloningCenter}),
		new Technology(GameEnums.TechName.NeutrinoPhysics, TechCategory.General, Galaxy.Civilization.Medieval, 650.0, true, false, new GameEnums.TechName[]{GameEnums.TechName.TachyonPhysics, GameEnums.TechName.BattleStation}),
		new Technology(GameEnums.TechName.AlienManagement, TechCategory.Sociology, Galaxy.Civilization.Medieval, 650.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.BattlePods}),
		new Technology(GameEnums.TechName.XenoPsychology, TechCategory.Sociology, Galaxy.Civilization.Medieval, 650.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.XenoRelationship}),
		new Technology(GameEnums.TechName.GraviticFields, TechCategory.General, Galaxy.Civilization.Medieval, 650.0, true, false, new GameEnums.TechName[]{GameEnums.TechName.NeutrinoPhysics, GameEnums.TechName.BattleStation}),
		new Technology(GameEnums.TechName.AntiGravHarness, TechCategory.Military, Galaxy.Civilization.Medieval, 650.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.GraviticFields}),
		new Technology(GameEnums.TechName.GyroDestabilizer, TechCategory.Military, Galaxy.Civilization.Medieval, 650.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.GraviticFields, GameEnums.TechName.NeutrinoPhysics}),
		new Technology(GameEnums.TechName.InertialStabilizer, TechCategory.Military, Galaxy.Civilization.Medieval, 650, false, true, new GameEnums.TechName[]{GameEnums.TechName.ScoutLab}),
		// new tree
		new Technology(GameEnums.TechName.ServoMechanics, TechCategory.General, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AntiGravHarness}),
		new Technology(GameEnums.TechName.Positronics, TechCategory.General, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.GraviticFields, GameEnums.TechName.NeutrinoPhysics}),
		new Technology(GameEnums.TechName.IonFission, TechCategory.General, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.ColdFusion, GameEnums.TechName.GyroDestabilizer}),
		new Technology(GameEnums.TechName.GeneticEngineering, TechCategory.Sociology, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.NeuralScanner, GameEnums.TechName.XenoPsychology}),
		new Technology(GameEnums.TechName.MagnetoGravitics, TechCategory.Cosmology, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.IonFission}),
		new Technology(GameEnums.TechName.AssaultShuttles, TechCategory.Military, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.InertialStabilizer}),
		new Technology(GameEnums.TechName.FastMissileRacks, TechCategory.Military, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.ServoMechanics}),
		new Technology(GameEnums.TechName.PlanetarySupercomputer, TechCategory.Sociology, Galaxy.Civilization.GreatLeap, 900.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.Positronics, GameEnums.TechName.IonFission}),
		new Technology(GameEnums.TechName.PositronicComputer, TechCategory.Sociology, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.PlanetarySupercomputer}),
		new Technology(GameEnums.TechName.NeutronBlaster, TechCategory.Military, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.NeutrinoPhysics}),
		new Technology(GameEnums.TechName.NeutronScanner, TechCategory.Cosmology, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.PositronicComputer, GameEnums.TechName.ServoMechanics}),
		new Technology(GameEnums.TechName.IonDrive, TechCategory.Cosmology, Galaxy.Civilization.GreatLeap, 900.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.IonFission, GameEnums.TechName.MagnetoGravitics}),
		new Technology(GameEnums.TechName.IonPulseCannon, TechCategory.Military, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.NeutronScanner}),
		new Technology(GameEnums.TechName.ShieldCapacitor, TechCategory.Military, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.MagnetoGravitics}),
		new Technology(GameEnums.TechName.Microbiotics, TechCategory.Ecology, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.GeneticEngineering}),
		new Technology(GameEnums.TechName.TelepathicTraining, TechCategory.Sociology, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.XenoPsychology, GameEnums.TechName.PositronicComputer}),
		new Technology(GameEnums.TechName.ClassIIIShield, TechCategory.Military, Galaxy.Civilization.GreatLeap, 900.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.ShieldCapacitor}),
		new Technology(GameEnums.TechName.PlanetaryRadiationShield, TechCategory.Ecology, Galaxy.Civilization.GreatLeap, 900.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.ShieldCapacitor, GameEnums.TechName.ClassIIIShield}),
		new Technology(GameEnums.TechName.WarpDissipater, TechCategory.Military, Galaxy.Civilization.GreatLeap, 900.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.PlanetaryRadiationShield, GameEnums.TechName.IonDrive, GameEnums.TechName.TelepathicTraining}),
		new Technology(GameEnums.TechName.AstroConstruction, TechCategory.Planetary, Galaxy.Civilization.GreatLeap, 1150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.PlanetaryRadiationShield}),
		new Technology(GameEnums.TechName.MolecularCompression, TechCategory.Ecology, Galaxy.Civilization.GreatLeap, 1150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.Microbiotics}),
		new Technology(GameEnums.TechName.ArtificialGravity, TechCategory.Planetary, Galaxy.Civilization.GreatLeap, 1150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AstroConstruction}),
		new Technology(GameEnums.TechName.MacroEconomics, TechCategory.Sociology, Galaxy.Civilization.GreatLeap, 1150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.PlanetarySupercomputer}),
		new Technology(GameEnums.TechName.GeneticMutations, TechCategory.Ecology, Galaxy.Civilization.GreatLeap, 1150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.MolecularCompression}),
		new Technology(GameEnums.TechName.Battleoids, TechCategory.Military, Galaxy.Civilization.GreatLeap, 1150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.IonPulseCannon}),
		new Technology(GameEnums.TechName.GroundBatteries, TechCategory.Military, Galaxy.Civilization.GreatLeap, 1150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.FastMissileRacks}),
		new Technology(GameEnums.TechName.TitanConstruction, TechCategory.Cosmology, Galaxy.Civilization.GreatLeap, 1150.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.ClassIIIShield, GameEnums.TechName.GroundBatteries, GameEnums.TechName.ArtificialGravity, GameEnums.TechName.ServoMechanics}),
		new Technology(GameEnums.TechName.AtmosphericRenewer, TechCategory.Planetary, Galaxy.Civilization.GreatLeap, 1150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.GeneticMutations, GameEnums.TechName.PlanetaryRadiationShield}),
		new Technology(GameEnums.TechName.IridiumFuelCells, TechCategory.Cosmology, Galaxy.Civilization.GreatLeap, 1150.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.MolecularCompression, GameEnums.TechName.ArtificialGravity, GameEnums.TechName.AtmosphericRenewer}),
		new Technology(GameEnums.TechName.PulsonMissile, TechCategory.Military, Galaxy.Civilization.GreatLeap, 1150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.Battleoids}),
		new Technology(GameEnums.TechName.GravitonBeam, TechCategory.Military, Galaxy.Civilization.GreatLeap, 1150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.ArtificialGravity, GameEnums.TechName.PulsonMissile}),
		new Technology(GameEnums.TechName.PlanetaryGravityGenerator, TechCategory.Planetary, Galaxy.Civilization.GreatLeap, 1150.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.TitanConstruction, GameEnums.TechName.GravitonBeam}),
		new Technology(GameEnums.TechName.TractorBeam, TechCategory.Military, Galaxy.Civilization.GreatLeap, 1150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.WarpDissipater, GameEnums.TechName.GravitonBeam}),
		new Technology(GameEnums.TechName.PlanetaryStockExchange, TechCategory.Sociology, Galaxy.Civilization.GreatLeap, 1150.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.TelepathicTraining}),
		new Technology(GameEnums.TechName.Terraforming, TechCategory.Planetary, Galaxy.Civilization.GreatLeap, 1150.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.ArtificialGravity, GameEnums.TechName.PlanetaryGravityGenerator, GameEnums.TechName.TitanConstruction}),
		new Technology(GameEnums.TechName.ArtificialConsciousness, TechCategory.Sociology, Galaxy.Civilization.GreatLeap, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.TelepathicTraining}),
		new Technology(GameEnums.TechName.SubspacePhysics, TechCategory.General, Galaxy.Civilization.GreatLeap, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.ArtificialGravity}),
		new Technology(GameEnums.TechName.MacroGenetics, TechCategory.Sociology, Galaxy.Civilization.GreatLeap, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.GeneticMutations}),
		new Technology(GameEnums.TechName.ElectroMagneticRefraction, TechCategory.General, Galaxy.Civilization.GreatLeap, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.WarpDissipater, GameEnums.TechName.GroundBatteries}),
		new Technology(GameEnums.TechName.AdvancedPlanetContruction, TechCategory.Planetary, Galaxy.Civilization.GreatLeap, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.AstroConstruction}),
		// new tree
		new Technology(GameEnums.TechName.AutomatedRepairUnit, TechCategory.Military, Galaxy.Civilization.Modern, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.GravitonBeam}),
		new Technology(GameEnums.TechName.Recyclotron, TechCategory.Ecology, Galaxy.Civilization.Modern, 1500.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.PlanetaryGravityGenerator, GameEnums.TechName.AtmosphericRenewer}),
		new Technology(GameEnums.TechName.CyberSecurityLink, TechCategory.Military, Galaxy.Civilization.Modern, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.Battleoids}),
		new Technology(GameEnums.TechName.EmissionsGuidanceSystem, TechCategory.Cosmology, Galaxy.Civilization.Modern, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.SubspacePhysics}),
		new Technology(GameEnums.TechName.RangemasterTargetingUnit, TechCategory.Cosmology, Galaxy.Civilization.Modern, 1500.0, false, true, new GameEnums.TechName[]{}),
		new Technology(GameEnums.TechName.JumpGate, TechCategory.Cosmology, Galaxy.Civilization.Modern, 1500.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.ElectroMagneticRefraction, GameEnums.TechName.SubspacePhysics}),
		new Technology(GameEnums.TechName.SubspaceCommunications, TechCategory.Sociology, Galaxy.Civilization.Modern, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.ArtificialConsciousness}),
		new Technology(GameEnums.TechName.SubterraneanFarms, TechCategory.Planetary, Galaxy.Civilization.Modern, 1500.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.MacroGenetics, GameEnums.TechName.Terraforming}),
		new Technology(GameEnums.TechName.WeatherController, TechCategory.Ecology, Galaxy.Civilization.Modern, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.Recyclotron}),
		new Technology(GameEnums.TechName.PersonalShield, Technology.TechCategory.Military, Galaxy.Civilization.Modern, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.ElectroMagneticRefraction}),
		new Technology(GameEnums.TechName.StealthField, TechCategory.Military, Galaxy.Civilization.Modern, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.SubspacePhysics, GameEnums.TechName.TractorBeam}),
		new Technology(GameEnums.TechName.StealthSuit, TechCategory.Military, Galaxy.Civilization.Modern, 1500.0, false, true, new GameEnums.TechName[]{GameEnums.TechName.PulsonMissile}),
		new Technology(GameEnums.TechName.ArtificialPlanetConstruction, TechCategory.Planetary, Galaxy.Civilization.Modern, 2000.0, true, true, new GameEnums.TechName[]{GameEnums.TechName.AdvancedPlanetContruction, GameEnums.TechName.Terraforming}),

	};

	public static Technology[] Table
	{
		get { return m_Table; }
	}

	// the static version of buildings
	private static Building[] m_Facility = new Building[]
	{
		new AlienManagementCenter(true),
		new ArmorBarrack(true),
		new ArtemisSystemNet(true),
		new ArtificialPlanetConstruction(true),
		new AstroUniversity(true),
		new AtmosphericRenewer(true),
		new Autolab(true),
		new AutomatedFactory(true),
		new BattleStation(true),
		new Biospheres(true),
		new CloningCenter(true),
		new ColonyBase(true),
		new CoreWasteDumps(true),
		new DeepCoreMine(true),
		new DimensionalPortal(true),
		new FighterBay(true),
		new FighterGarrison(true),
		new FoodReplicators(true),
		new GaiaTransformation(true),
		new GalacticCybernet(true),
		new GroundBatteries(true),
		new HoloSimulator(true),
		new HydroponicFarm(true),
		new MarineBarrack(true),
		new MissileBase(true),
		new PlanetaryBarrierShield(true),
		new PlanetaryFluxShield(true),
		new PlanetaryGravityGenerator(true),
		new PlanetaryRadiationShield(true),
		new PlanetaryStockExchange(true),
		new PlanetarySupercomputer(true),
		new PleasureDome(true),
		new PollutionProcessor(true),
		new PoweredArmor(true),
		new Recyclotron(true),
		new ResearchLaboratory(true),
		new RoboMiningPlant(true),
		new RoboticFactory(true),
		new SoilEnrichment(true),
		new SpaceAcademy(true),
		new SpaceChapel(true),
		new SpaceEntertainmentCompound(true),
		new SpacePort(true),
		new StarBase(true),
		new StarFortress(true),
		new StellarConverter(true),
		new SubterraneanFarms(true),
		new Terraforming(true),
		new WarpFieldInterdictor(true),
		new WeatherController(true),
	};

	public static Building[] BTable
	{
		get { return m_Facility; }
	}

	private static IBuildable[] m_Dispatchable = new IBuildable[]
	{
		new ColonyShip(),
		new Freighters(),
		new OutpostShip(),
		new Satellite(),
		new TransportShip()
	};

	public static IBuildable[] DTable
	{
		get { return m_Dispatchable; }
	}

	private static IBuildable[] m_Warship = new IBuildable[]
	{
		new Frigate(),
		new Destroyer(),
		new Cruiser(),
		new Battleship(),
		new Titan(),
		new DoomStar(),
	};

	public static IBuildable[] WTable
	{
		get { return m_Warship; }
	}
}